The present invention relates to a large receive offload (LRO) method and a network device, and more particularly, to an LRO method and a network device capable of utilizing the LRO rings efficiently.
The amount of web traffic over the internet is increasing. Much of the increase in web traffic is due to increased social media usage, cloud based storage, online media steaming services, etc. Therefore, the amount of data to be processed by network devices and/or throughput requirements for network devices is increasing. Moreover, the majority of internet web traffic is Transmission Control Protocol (TCP) based web traffic, which causes a significant overhead for the network devices to process TCP based web traffic.
Offload approaches may be used in network device to reduce network stack processing overheads. For example, a network device may use a large receive offload (LRO) technique to reduce a reception stack overhead for packet reception processing. LRO is a technique for increasing throughput by reducing utilization of a system central processing unit (CPU). The LRO technique works by aggregating incoming packets from Ethernet Layer belonging to a single data stream into larger packets and delivering the larger packets to an upper TCP layer, so as to alleviate a burden of the network device processing headers of the packets. Specifically, the incoming packets from the Ethernet Layer are stored in an LRO ring to be aggregated. In practice, the network device usually comprises a plurality of LRO rings for storing incoming packets from a plurality of data streams to further perform LRO aggregation.
The LRO rings, being a storage device as memory, are precious resources for the network device in a hardware point of view, which is expected to be utilized as efficient as possible. In the prior art, allocating LRO rings to data streams takes a first-in-first-out fashion, without considering any properties of data streams from the Ethernet Layer, which might utilize the LRO rings inefficiently. Therefore, how to utilize the LRO rings efficiently is a significant objective in the field.